<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" >
<title>登陆</title>
<link  type="text/css" href="/static/css/login.css" rel="stylesheet">
</head>

<body class="login" >
<div class="login_m">
    <div class="login_logo">
        <img src="/static/images/logo.png" width="196" height="46">
    </div>
    <div class="login_boder login_height">
        <div class="login_padding" id="login_model">
        <form id="login_form">
            <div class="username">
                <h2>USERNAME</h2>
                <label>
                    <input type="text" id="username" name="username" class="txt_input" placeholder="用户名/手机号">
                </label>
                <span class="uspan"></span>
            </div>
            <div class="password">
                <h2>PASSWORD  <p style="display:inline-block;"><a href="getpwd">Forgot your password?</a></p></h2>
                <label>
                    <input type="password" id="userpwd" name="pwd"  class="txt_input"  placeholder="the password">
                </label>
                <span class="pspan"></span>
            </div>
            <div class="verify" >
                <h2>CAPTCHA </h2>
                <label>
                    <input type="text"  id="verify" name="verify" class="verify_input"  placeholder="the captcha">
                    <img src="{:captcha_src()}" class="verify_img"  width="120px" height="40px"  onclick="this.src='{:captcha_src()}?tmp='+Math.random()">
                </label>
                <label>
                    <span class="vspan"></span>
                </label>
            </div>
            <div class="button">
                <label>
                    <a href="{:url('register')}" >快&nbsp;速&nbsp;注&nbsp;册&nbsp;</a>
                </label>
                <label>
                    <!-- <input type="button" class="sub_button"  id="button" value="登陆" style="opacity: 0.7;"> -->
                    <a  href="javascript:void(0);"  id="button" class="sub_button">登&nbsp;陆</a>
                </label>
                <label>
                    <span class="bspan"></span>
                </label>
            </div>
        </form>
        </div><!--login_padding  Sign in end-->     
    </div><!--login_boder end-->

    <div class="copyrights">
        Collect from <a href="#" >#########</a>
    </div>
</div><!--login_m end-->

<script type="text/javascript" src="/static/js/jquery/jquery.js"  ></script>
<script type="text/javascript" src="/static/js/myfunc.js"></script>
<script type="text/javascript" src="/static/js/login.js"></script>
<script>    
$("#username").blur(function(){
    checkUsername();
});

$("#userpwd").blur(function(){
    checkPwd();
});

$("#verify").blur(function(){
    checkVerify();
});

//提交表单信息
$("#button").click(function(){
    var username=checkUsername();
    if(!username)  return false;

    var pwd=checkPwd();
    if(!pwd)  return false;

    var verify=checkVerify();
    if(!verify) return false;

    $.ajax({
        type:"POST",
        url:"{:url('login')}",
        data:{'username':username,'pwd':pwd,'verify':verify},
        dataType:"json",
        success:function(data){
            $('.bspan').html(data.msg);
            if(data.status==4){
                window.location.href="{:url('index/index')}";
                return false;
            }else{
                return false;
            }
        }
    });
});

</script>

</body>
</html>